#ifndef SKEYB_H
#define SKEYB_H

#define ClipboardSize 1024
#define KeyLightTime 10

#define SetKeyLight(sprite, rot, x, y, width, height){\
	PA_SetSpriteXY(SKeybScr, sprite, x-(128-width)/2, y-(64-height)/2);\
	PA_SetRotsetNoAngle(SKeybScr, rot, 256*64/width, 256*32/height);\
	KeyLightTimer = 0;\
}	


void InitSKeyboard(u8 Screen, u8 BG, u8 Sprite, u8 SPallete, u8 SlowShow = 1, u8 SRotSet = 0, u8 StripCodes = 0);
void DestroySKeyboard(u8 SlowShow = 1);
int SKeybTouch(char* Text, int MaxLength, int& CursorPos, u16& SelStart, u16& SelStop, u8 Multiline);
void DrawPseudoKeyboard(int Screen, int BG, int brighness);
void EmptyClipboard();
void DeleteSelection(char* Text, int& CursorPos, u16& SelStart, u16& SelStop);
void CopyToClipboard(char* Text, u16 SelStart, u16 SelStop);
u8 InsertText(char* Text, char* InsText, u16 MaxLength, int& CursorPos, u16& SelStart, u16& SelStop);
void PasteClipboard(char* Text, int MaxLength, int& CursorPos, u16& SelStart, u16& SelStop, u8 Multiline);
void MoveStringRight(char* Text, int CursorPos, int steps);
void MoveStringLeft(char* Text, int CursorPos, int steps);
void SKeybUpdate();

#endif

